package io.gitee.hchaojie.day03.tetris;

import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.Background;
import javafx.scene.layout.BackgroundFill;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

public class Main extends Application {
	// 每个小方格的大小
	public static final double SQAURE_SIZE = 35;

	@Override
	public void start(Stage stage) throws Exception {
		Scene scene = new Scene(createContents());
		stage.setScene(scene);
		stage.setResizable(false);
		stage.sizeToScene();
		stage.show();
	}

	// 在这里创建页面布局
	private Parent createContents() {
		HBox box = new HBox();
		
		Board board = new Board(SQAURE_SIZE);
		board.setBackground(new Background(new BackgroundFill(Color.BLACK, null, null)));
		
		ControlPane controlPane = new ControlPane(board);

		box.getChildren().addAll(board, controlPane);
		return box;
	}

	public static void main(String[] args) {
		launch(args);
	}
}